import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:tiktok/index.dart';
import 'package:tiktok/welcome.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light);
    return MaterialApp(
      themeMode: ThemeMode.dark,
      theme: ThemeData().copyWith(
        brightness: Brightness.light, //控件颜色模式Light
        primaryColor: Colors.black, //设置主题色为黑色即可
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({
    super.key,
  });

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  void initState() {
    super.initState();
    Future.delayed(const Duration(seconds: 3), () {
      Navigator.pushAndRemoveUntil(context,
          MaterialPageRoute(builder: (content) {
        return const IndexWidget();
      }), (route) => false);
    });
  }

  @override
  Widget build(BuildContext context) {
    return const WelComeWidget();
  }
}
